package com.sky.mapper.admin;

import com.sky.dto.GoodsSalesDTO;
import com.sky.dto.OrderSumDTO;
import com.sky.pojo.UserReport;
import com.sky.vo.DishOverViewVO;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface ReportMapper {
    List<OrderSumDTO> orderAmountStatistics(LocalDate begin, LocalDate end, Integer status);

    Integer userStatistics(LocalDate begin, LocalDate end);

    List<OrderSumDTO> orderStatistics(LocalDate begin, LocalDate end);

    List<GoodsSalesDTO> top10Statistics(LocalDate begin, LocalDate end);

    @Insert("insert into user_report (date,total_user,new_user) values (#{date},#{totalUser},#{newUser})")
    void addUserReport(UserReport userReport);

    @Select("select * from user_report where date between #{begin} and #{end}")
    List<UserReport> findUserStatistics(LocalDate begin, LocalDate end);

    DishOverViewVO overViewDishOrSetmeal(String tableName);
}
